package drds.binlog.protocol.entry_protocol_proto;

/**
 * <pre>
 * *数据库类型*
 * </pre>
 * <p>
 * Protobuf enum {@code com.alibaba.otter.canal.protocol.Type}
 */
public enum Type
        implements com.google.protobuf.ProtocolMessageEnum
{
    /**
     * <code>TYPECOMPATIBLEPROTO2 = 0;</code>
     */
    TYPECOMPATIBLEPROTO2(0),
    /**
     * <code>ORACLE = 1;</code>
     */
    ORACLE(1),
    /**
     * <code>MYSQL = 2;</code>
     */
    MYSQL(2),
    /**
     * <code>PGSQL = 3;</code>
     */
    PGSQL(3),
    UNRECOGNIZED(-1),;

    /**
     * <code>TYPECOMPATIBLEPROTO2 = 0;</code>
     */
    public static final int TYPECOMPATIBLEPROTO2_VALUE = 0;
    /**
     * <code>ORACLE = 1;</code>
     */
    public static final int ORACLE_VALUE = 1;
    /**
     * <code>MYSQL = 2;</code>
     */
    public static final int MYSQL_VALUE = 2;
    /**
     * <code>PGSQL = 3;</code>
     */
    public static final int PGSQL_VALUE = 3;
    private static final com.google.protobuf.Internal.EnumLiteMap<
            Type> internalValueMap =
            new com.google.protobuf.Internal.EnumLiteMap<Type>()
            {
                public Type findValueByNumber(int number)
                {
                    return Type.forNumber(number);
                }
            };
    private static final Type[] VALUES = values();
    private final int value;

    private Type(int value)
    {
        this.value = value;
    }

    /**
     * @deprecated Use {@link #forNumber(int)} instead.
     */
    @Deprecated
    public static Type valueOf(int value)
    {
        return forNumber(value);
    }

    public static Type forNumber(int value)
    {
        switch (value)
        {
            case 0:
                return TYPECOMPATIBLEPROTO2;
            case 1:
                return ORACLE;
            case 2:
                return MYSQL;
            case 3:
                return PGSQL;
            default:
                return null;
        }
    }

    public static com.google.protobuf.Internal.EnumLiteMap<Type>
    internalGetValueMap()
    {
        return internalValueMap;
    }

    public static final com.google.protobuf.Descriptors.EnumDescriptor
    getDescriptor()
    {
        return BinlogEntry.getDescriptor().getEnumTypes().get(2);
    }

    public static Type valueOf(
            com.google.protobuf.Descriptors.EnumValueDescriptor desc)
    {
        if (desc.getType() != getDescriptor())
        {
            throw new IllegalArgumentException(
                    "EnumValueDescriptor is not for this type.");
        }
        if (desc.getIndex() == -1)
        {
            return UNRECOGNIZED;
        }
        return VALUES[desc.getIndex()];
    }

    public final int getNumber()
    {
        if (this == UNRECOGNIZED)
        {
            throw new IllegalArgumentException(
                    "Can't get the number of an unknown enum value.");
        }
        return value;
    }

    public final com.google.protobuf.Descriptors.EnumValueDescriptor
    getValueDescriptor()
    {
        return getDescriptor().getValues().get(ordinal());
    }

    public final com.google.protobuf.Descriptors.EnumDescriptor
    getDescriptorForType()
    {
        return getDescriptor();
    }

    // @@protoc_insertion_point(enum_scope:com.alibaba.otter.canal.protocol.Type)
}
